﻿using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using Auditiac.FluentMapping;

namespace Auditiac
{
    public class AuditiacContext : DbContext
    {
        public AuditiacContext() : base("AuditiacConnection") { }
        public DbSet<Account> Accounts { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            // Configure Code First to ignore PluralizingTableName convention 
            // If you keep this convention then the generated tables will have pluralized names. 
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();

            modelBuilder.Configurations.Add(new AccountMap());
        } 
    }
}
